<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<ul id="ul">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
</ul>
<script>
    var ul=document.getElementById("ul");
    ul.onclick=function(e){
        console.log(e.target);
        e.target.style.backgroundColor="red";
        e.currentTarget.style.backgroundColor="";
    }
</script>
</body>
</html>